package com.liuyi.observer;

import java.util.Observable;
import java.util.Observer;

import android.util.Log;

public class MyObserver implements Observer {
	
	private String name;
	
	public MyObserver(String name) {
		super();
		this.name = name;
	}

	@Override
	public void update(Observable observable, Object data) {
		String msg = (String)data;
		if("obj".equals(msg)){
			MyObservable myObservable = (MyObservable) observable;
			Log.d("tag", name + "MyObserver 收到:" + myObservable.getName());
		}else{
			Log.d("tag", "obj != msg");
		}
	}

}
